﻿
using System.Data;

namespace ExcelExport
{
    public class GenerateFile
    {
        private GenerateJson gJson;
        private GenerateLua gLua;
        private GenerateCS gCS;

        public void Init()
        {
            gJson = new GenerateJson();
            gLua = new GenerateLua();
            gCS = new GenerateCS();
        }

        public void Generate(string className, List<TableField> fieldList,DataTable dt )
        {

            if (Util.exportJson)
            {
                gJson.WriteToFile(className, fieldList, dt);
            }

            if (Util.exportLua)
            {
                gLua.WriteToFile(className, fieldList,dt);
            }

            if (Util.exportCS)
            {
                gCS.WriteToFile(className, fieldList,dt);   
            }
        }
    }
}
